package com.kata.chapter7;

/**
 * Created by tzhang on 11/21/2014.
 */
public class Main {

    public static void main(String[] args) {
        IArmsDealers armsDealers = new ArmsDealersProxy();
        String gun;
        System.out.println("来了个客人, 想随便要一把手枪");
        gun = armsDealers.buyPistol();
        System.out.println(gun);
        System.out.println("==========================");

        System.out.println("来了个客人, 是个筋肉人, 想随便要一把手枪");
        armsDealers = new ArmsDealersProxy(new JBOSS());
        gun = armsDealers.buyPistol();
        System.out.println(gun);
        System.out.println("==========================");

        System.out.println("来了个客人, 看起来像个狙击手, 想随便要一把大威力步枪");
        armsDealers = new ArmsDealersProxy(new JBOSS());
        gun = armsDealers.buyRifle();
        System.out.println(gun);
        System.out.println("==========================");

        System.out.println("来了个客人, 感觉是个愤青, 给他一把便宜的步枪玩吧");
        armsDealers = new ArmsDealersProxy(new DMZ());
        gun = armsDealers.buyRifle();
        System.out.println(gun);
        System.out.println("==========================");



    }
}
